

#include "iostream"
#include "vector"
#include "unordered_map"
#include "unordered_set"
#include "algorithm"
#include "string"
#include "list"
#include "string.h"


class OneLoop {
public:
    std::vector<int> final;

    bool first_print=true;
    void print(int xishu,int cishu){
        if(xishu==0){
            goto end;
        }else if(xishu>0){
            if(xishu==1){
                if(first_print){
//                    printf("");
                }else{
                    printf("+");
                }
            }else{
                if(first_print){
                    printf("%d",xishu);
                }else{
                    printf("+%d",xishu);
                }
            }
        }else{
            if(xishu==-1){
                printf("-");
            }else{
                printf("%d",xishu);
            }
        }
        if(cishu==1){
            printf("x");
        }else{
            printf("x^%d",cishu);
        }
        end:
        first_print=false;
    }
    bool run(int a
    ) {
        for(int i=0;i<=a;i++){
            int in;std::cin>>in;
            final.push_back(in);
        }
        for(int i=a;i>0;i--){
            print(final[a-i],i);
        }
        if(final[a]>0){
            printf("+%d",final[a]);
        }else if(final[a]<0){
            printf("%d",final[a]);
        }
        return true;
    }
};

class Solution {
public:
    void run() {

        bool first = true;
        int a, b, c, d, e;
        //        std::cin >> a;

        while (std::cin>>a) {
            OneLoop l;
            if (!l.run(a)) {
                //                return;
            }
        }


    }
};

int main() {
    //    bool cur_num= true;
    Solution().run();
    return 0;
}

